Cette page est en cours de rédaction

Installation

à partir des dépôts

Les paquet présent dans raring semblent ne pas fonctionner

Installer les paquets python-pocketsphinx libpocketsphinx1 gstreamer0.10-pocketsphinx python-pyaudio

apt-get install python-pocketsphinx libpocketsphinx1 gstreamer0.10-pocketsphinx python-pyaudio

à partir des sources

D'abord il faut installer les dépendances

sudo apt-get build-dep pocketsphinx
sudo apt-get install bison python-pyaudio

sphinxbase

On récupère ensuite les sources de sphinxbase-0.8

wget -O sphinxbase-0.8.tar.gz http://sourceforge.net/projects/cmusphinx/files/sphinxbase/0.8/sphinxbase-0.8.tar.gz/download

On les décompresse

tar -xvzf sphinxbase-0.8.tar.gz

On compile

Si vous avez l'erreur :
    import pocketsphinx as ps
  File "sphinxbase.pxd", line 150, in init pocketsphinx (pocketsphinx.c:7935)
ValueError: PyCapsule_GetPointer called with invalid PyCapsule object

il faut régénérer le fichier python/sphinxbase.c ref

sudo apt-get install cython
mv python/sphinxbase.c ~

puis relancer la compilation a partir de ./configure

./configure --prefix=/usr/local
make
sudo make install

pocketsphinx

wget -O pocketsphinx-0.8.tar.gz http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/0.8/pocketsphinx-0.8.tar.gz/download
tar -xvzf pocketsphinx-0.8.tar.gz
cd pocketsphinx-0.8
./configure --prefix=/usr/local
make
sudo make install

modèles français

Téléchargement:

wget -O lium_french_f0.tar.gz http://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French%20F0%20Broadcast%20News%20Acoustic%20Model/lium_french_f0.tar.gz/download
tar -xvzf lium_french_f0.tar.gz
cd lium_french_f0/
sudo mkdir /usr/share/pocketsphinx/model/FR/
sudo mv * /usr/share/pocketsphinx/model/FR/

wget -O french3g62K.lm.dmp.bz2 http://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French%20Language%20Model/french3g62K.lm.dmp.bz2/download
bzip2 -d french3g62K.lm.dmp.bz2
sudo mv french3g62K.lm.dmp /usr/share/pocketsphinx/model/FR/

wget -O frenchWords62K.dic http://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French%20Language%20Model/frenchWords62K.dic/download
sudo mv frenchWords62K.dic /usr/share/pocketsphinx/model/FR/


wget -O lium_french_f2.tar.gz http://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French%20F2%20Telephone%20Acoustic%20Model/lium_french_f2.tar.gz/download

test

pocketsphinx_continuous

pocketsphinx_continuous -dict /usr/share/pocketsphinx/model/FR/frenchWords62K.dic -hmm /usr/share/pocketsphinx/model/FR/ -lm /usr/share/pocketsphinx/model/FR/french3g62K.lm.dmp

références

Site officiel : http://cmusphinx.sourceforge.net/wiki/download/

Python audio : http://people.csail.mit.edu/hubert/pyaudio/docs/

Exemple en python: http://pythonism.wordpress.com/2013/06/06/pocketsphinx-voice-recognition-with-python/

http://stackoverflow.com/questions/8567366/geting-ioerror-errno-input-overflowed-9981-when-setting-pyaudio-stream-input